<template>
  <el-page-header @back="handleBack">
    <template #icon>
      <el-icon>
        <ArrowLeft />
      </el-icon>
    </template>
    <template #content>
      <span class="text-large font-600 mr-3">新增医生团队</span>
    </template>
  </el-page-header>
  <el-row>
    <el-col :span="24">
      <el-form :model="form" label-width="auto" style="max-width: 600px">
        <el-form-item label="团队名称">
          <el-input v-model="form.teamName" />
        </el-form-item>
        <el-form-item label="团队标签">
          <el-input v-model="form.label" />
        </el-form-item>
        <el-form-item label="团队状态">
          <el-radio-group v-model="form.status">
            <el-radio value="1">启用中</el-radio>
            <el-radio value="2">禁用中</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="团队简介">
          <el-input v-model="form.introduction" type="textarea" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">提交</el-button>
        </el-form-item>
      </el-form>
    </el-col>
  </el-row>
</template>
<script>
import { ArrowLeft } from "@element-plus/icons-vue";
import {addSysTeam} from "../api/SysTeam.js";
export default {
  name: "AddTeam",
  components: {
    ArrowLeft
  },
  data(){
    return{
      form:{
        teamName: '',
        label: '',
        status: '1', // 明确默认值
        introduction: '',
        leaderId: '',
      }
    }
  },
  methods:{
    handleBack() {
      this.$router.go(-1);
    },
    async onSubmit(){
      console.log(this.form)
      let {data:data}=await addSysTeam(this.form)
      this.$router.go(-1);
    }
  },
  created() {
    this.doctorId = this.$route.query.doctorId;
    this.form.leaderId = this.doctorId;
    console.log(this.doctorId)
  }
}
</script>


<style scoped>

</style>